package question2;

public class Building {
    private String name;
    private College college;

    public Building(String name, College college) {
        this.name = name;
        this.college = college;
    }

    public String getName() {
        return name;
    }

    public College getCollege() {
        return college;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setCollege(College college) {
        this.college = college;
        college.addBuilding(this);  // 反向关联学院
    }
}
